/**
 * @Description: 用户接口
 * @Author: wrysunny
 * @Date: 2024-11-18 18:26:11
 * @LastEditor: wrysunny
 * @LastEditTime: 2024-12-11 11:49:12
 */
import http from '@/utils/http.js';

// 登录
export const getTokenByH5 = (data) => {
	return http.post('/public/login/wx', data)
}
// 获取用户信息
export const getUserInfo = (data) => {
	return http.get('/auth/user/home', data)
	// return http.get('/auth/user/info', data)
}
//用户会员信息
export const getUserMember = () => {
	return http.get('/auth/user/equity/info')
}
//修改用户信息
export const updateUserInfo = (data) => {
	return http.put('/auth/user/update', data)
}
//绑定手机号
export const bindPhone = (data) => {
	return http.put('/auth/user/phone', data)
}
//查询用户地址
export const getUserAddress = (data) => {
	return http.get('/auth/user/address/list', data)
}

//新增用户地址
export const addUserAddress = (data) => {
	return http.post('/auth/user/address/add', data)
}

//修改用户地址
export const updateUserAddress = (data) => {
	return http.put('/auth/user/address/update', data)
}

//删除用户地址
export const deleteUserAddress = (id) => {
	return http.delete(`/auth/user/address/${id}`)
}

//获取默认地址
export const getDefaultAddress = (data) => {
	return http.get('/auth/user/address', data)
}

//用户消息列表
export const getUserMessage = (data) => {
	return http.get('/auth/notify/list', data)
}